{% extends "./inc_base.html" %}
{% block style %}
<link href="/static/assets/css/layout-question.css" rel="stylesheet" type="text/css" />
{% endblock %}
{% block content %}
<section>
    <div class="container">
        {{11|show_ad("code")|safe}}
        <div class="row">
            <div class="col-md-9">
                <!-- REVOLUTION SLIDER -->
                <div class="slider fullwidthbanner-container roundedcorners margin-bottom-0">
                    <div class="fullwidthbanner" data-height="550" data-shadow="" data-navigationStyle="preview2">
                        <ul class="hide">
                            {% topic data = "slider",limit= "5",position='home',issub="1"%}
                            {%for val in slider%}
                            {%if val.model_id==4%} {% set pic = val.pics|strToArray%}{%else%}{%set pic =
                            val.cover_id%}{%endif%}
                            <!-- SLIDE  -->
                            <li data-transition="fade" data-slotamount="7" data-masterspeed="300" data-saveperformance="off">
                                <img src="/static/assets/images/1x1.png" data-lazyload="{{pic|get_pic('m=2,w=848,h=400')}}"
                                    alt="" data-bgfit="cover" data-bgposition="center center" data-bgrepeat="no-repeat" />
                                <div class="tp-caption lft start" data-x="0" data-y="0" data-speed="750" data-start="750"
                                    data-easing="easeOutExpo" data-elementdelay="0.1" data-endelementdelay="0.1"
                                    data-endspeed="300">
                                    <img src="/static/assets/images/1x1.png" alt="" data-lazyload="/static/assets/images/caption_bg.png">
                                </div>
                                <a class="tp-caption medium_light_white lfb start" href="{{val.name|get_url(val.id)}}"
                                    target="_blank" data-x="left" data-hoffset="70" data-y="96" data-speed="300"
                                    data-start="1200" data-easing="easeOutExpo" data-splitin="none" data-splitout="none"
                                    data-elementdelay="0.1" data-endelementdelay="0.1" data-endspeed="300">
                                    {{val.title|truncate(20, true, "")|insert_flg("<br>",10)|safe}}
                                </a>
                                <div class="tp-caption block_black lfl start" data-x="left" data-hoffset="70" data-y="195"
                                    data-speed="300" data-start="1500" data-easing="easeOutExpo" data-splitin="none"
                                    data-splitout="none" data-elementdelay="0.1" data-endelementdelay="0.1"
                                    data-endspeed="300">
                                    {{val.create_time|moment('YYYY-MM-DD HH:mm')}}
                                </div>
                                <div class="tp-caption small_light_white lfl start" data-x="left" data-hoffset="70"
                                    data-y="250" data-speed="1000" data-start="1800" data-easing="easeOutExpo"
                                    data-splitin="none" data-splitout="none" data-elementdelay="0.1"
                                    data-endelementdelay="0.1" data-endspeed="300">
                                    {{val.description|truncate(90, true, "...")|insert_flg("<br>",20)|safe}}
                                </div>
                            </li>
                            {%endfor%}
                        </ul>
                        <div class="tp-bannertimer">
                            <!-- progress bar -->
                        </div>
                    </div>
                </div>
                <!-- /REVOLUTION SLIDER -->
            </div>
            <div class="col-md-3">
                <div class="panel panel-default margin-bottom-0">
                    <div class="panel-heading">
                        <a class="btn btn-primary btn-xs pull-right"><i class="fa fa-fire"></i></a>
                        <h2 class="panel-title">热点</h2>
                    </div>
                    <div class="panel-body con " style="height: 354px">
                        <ol class="current">
                            {%model data="hotnews",table="document",order="view DESC,create_time
                            DESC",limit="10",where='{"status":1}',cache="1000"%}
                            {% for val in hotnews %}
                            <li>
                                <span {%if loop.index < 4 %}class="topRank" {%endif%}>{{loop.index}}</span><a target="_blank"
                                    href="{{val.name|get_url(val.id)}} ">{{val.title}}</a>
                            </li>
                            {%endfor%}
                        </ol>
                    </div>
                </div>
            </div>
            {%if 14|show_ad('code')%}
            <!-- INFO BAR -->
            <div class="margin-top-20 col-md-12 ">
                {{14|show_ad('code')|safe}}
            </div>
            <!-- /INFO BAR -->
            {%endif%}
            <!-- RIGHT -->
            <div class="col-sm-9 margin-top-20">
                <ul class="nav nav-tabs nav-justified" style="position: inherit;background-color: #f1f2f7">
                    <li class="active"><a href="#new" data-toggle="tab" class="size-18">最新</a></li>
                    {{HOOK@hometitle|safe}}
                    {#
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#dropdown1" tabindex="-1" data-toggle="tab">@fat</a></li>
                            <li><a href="#dropdown2" tabindex="-1" data-toggle="tab">@mdo</a></li>
                        </ul>
                    </li>
                    #}
                </ul>
                <div class="panel panel-default" style="margin-top: -5px">
                    <div class="panel-body padding-10">
                        <div class="tab-content">
                            <div class="tab-pane fade in active" id="new">
                                {% topic data = "newlist",limit="10"%}
                                {% for val in newlist %}
                                {% set categoryname = val.category_id|get_cate %}
                                {%if val.model_id==4%}
                                {% set pic = val.pics|strToArray%}
                                <!-- POST ITEM -->
                                <div class="blog-post-item padding-bottom-20 margin-bottom-20 clearfix">
                                    <!-- IMAGE -->
                                    {% if pic[0]>0 %}
                                    <figure class="blog-item-small-image margin-bottom-0">
                                        <img class="img-responsive lazy" data-original="{{pic[0]|get_pic('m=1,w=200,h=120')}}"
                                            alt="">
                                    </figure>
                                    {% endif %}
                                    <div class="blog-item-small-content">
                                        <h2>
                                            <a href="{{val.name|get_url(val.id)}}" target="_blank" title="{{val.title}}">{{val.title|truncate(50,
                                                true, "...")}}
                                            </a>
                                        </h2>
                                        <ul class="blog-post-info list-inline padding-bottom-10">
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-clock-o"></i>
                                                    <span class="font-lato">{{val.create_time|moment('YYYY-MM-DD
                                                        HH:mm')}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-comment-o"></i>
                                                    <span class="font-lato">{{val.view}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <i class="fa fa-folder-open-o"></i>
                                                <a class="category" href="{{categoryname.url}}">
                                                    <span class="font-lato">{{categoryname.name}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-user"></i>
                                                    <span class="font-lato">{{val.uid|get_nickname}}</span>
                                                </a>
                                            </li>
                                        </ul>
                                        <p>
                                            <div class="shop-item-price" style="font-size: 20px;margin-top: 6px;font-weight: bold; float: left">
                                                {% if val.price|get_price_format('2') %}<span class="line-through"
                                                    style="color: #999;font-size: 15px;display: inline-block;padding: 0 10px;font-weight: 400;">¥{{val.price|get_price_format('2')}}</span>{%endif%}
                                                ¥{{val.price|get_price_format('1')}}
                                            </div>
                                            <div class="shop-item-buttons" style="float: left;margin-left: 15px">
                                                <a class="btn btn-default" href="{{val.name|get_url(val.id)}}" target="_blank"><i
                                                        class="fa fa-cart-plus"></i> 立即购买</a>
                                                <!-- replace data-item-id width the real item ID - used by js/view/demo.shop.js -->
                                                <a class="btn btn-default add-wishlist" href="#" data-item-id="1"
                                                    data-toggle="tooltip" title="" data-original-title="Add To Wishlist"><i
                                                        class="fa fa-heart nopadding"></i></a>
                                                <a class="btn btn-default add-compare" href="#" data-item-id="1"
                                                    data-toggle="tooltip" title="" data-original-title="Add To Compare"><i
                                                        class="fa fa-bar-chart-o nopadding" data-toggle="tooltip"></i></a>
                                            </div>
                                        </p>
                                    </div>
                                </div>
                                <!-- /POST ITEM -->
                                {%elif val.model_id === 10 %}
                                <!-- POST ITEM -->
                                <div class="blog-post-item padding-bottom-20 margin-bottom-20 clearfix">
                                    <div class="ribbon">
                                        <div class="ribbon-inner">{% if null|getnow < val.create_time %}未开幕{%elif
                                                (null|getnow> val.create_time) and (null|getnow <
                                                    val.deadline)%}展览中{%elif null|getnow> val.deadline%}已结束{%endif%}
                                        </div>
                                    </div>
                                    <!-- IMAGE -->
                                    {% if val.cover_id>0 %}
                                    <figure class="blog-item-small-image margin-bottom-0">
                                        <img class="img-responsive lazy" data-original="{{val.cover_id|get_pic('m=1,w=200,h=120')}}"
                                            alt="">
                                    </figure>
                                    {% endif %}
                                    <div class="blog-item-small-content">
                                        <h2><a href="{{val.name|get_url(val.id)}}" target="_blank" title="{{val.title}}">{{val.title|truncate(50,
                                                true, "...")}}</a></h2>
                                        <ul class="blog-post-info list-inline padding-bottom-10">
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-clock-o"></i>
                                                    <span class="font-lato">{{val.create_time|moment('YYYY-MM-DD
                                                        HH:mm')}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-comment-o"></i>
                                                    <span class="font-lato">{{val.view}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <i class="fa fa-folder-open-o"></i>

                                                <a class="category" href="{{categoryname.url}}">
                                                    <span class="font-lato">{{categoryname.name}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-user"></i>
                                                    <span class="font-lato">{{val.uid|get_nickname}}</span>
                                                </a>
                                            </li>
                                        </ul>
                                        <div class="alert alert-mini alert-success ">
                                            <!-- SUCCESS -->
                                            <strong></strong> <span style="width: 60px"><i class="fa fa-calendar-check-o"></i>
                                                开始:</span> {{ val.create_time|moment('YYYY-MM-DD') }} <span style="width: 60px"><i
                                                    class="fa fa-calendar-times-o"></i> 结束:</span>
                                            {{val.deadline|dateformat('Y-m-d')}} <span style="width: 60px"><i class="fa fa-map-marker"></i>
                                                地点:</span> {{val.id|getmodelfield(val.model_id,'addr')}}
                                        </div>
                                    </div>
                                </div>
                                <!-- /POST ITEM -->
                                {%else%}
                                <!-- POST ITEM -->
                                <div class="blog-post-item padding-bottom-20 margin-bottom-20 clearfix">
                                    <!-- IMAGE -->
                                    {% if val.cover_id>0 %}
                                    <figure class="blog-item-small-image margin-bottom-0">
                                        <img class="img-responsive lazy" data-original="{{val.cover_id|get_pic('m=1,w=200,h=120')}}"
                                            alt="">
                                    </figure>
                                    {% endif %}
                                    <div class="blog-item-small-content">
                                        <h2><a href="{{val.name|get_url(val.id)}}" target="_blank" title="{{val.title}}">{{val.title|truncate(50,
                                                true, "...")}}</a></h2>

                                        <ul class="blog-post-info list-inline padding-bottom-10">
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-clock-o"></i>
                                                    <span class="font-lato">{{val.create_time|moment('YYYY-MM-DD
                                                        HH:mm')}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-comment-o"></i>
                                                    <span class="font-lato">{{val.view}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <i class="fa fa-folder-open-o"></i>

                                                <a class="category" href="{{categoryname.url}}">
                                                    <span class="font-lato">{{categoryname.name}}</span>
                                                </a>
                                            </li>
                                            <li>
                                                <a href="#">
                                                    <i class="fa fa-user"></i>
                                                    <span class="font-lato">{{val.uid|get_nickname}}</span>
                                                </a>
                                            </li>
                                        </ul>
                                        <p>{{val.description|truncate(90, true, "...")}}</p>
                                    </div>
                                </div>
                                <!-- /POST ITEM -->
                                {%endif%}
                                {%endfor%}
                            </div>
                            {{HOOK@homelist|safe}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- LEFT -->
        <div class="col-md-3 col-sm-3 margin-top-20">
            {% if controller.is_login %}
            <div class="alert alert-info margin-bottom-20 box-shadow-4">
                <!-- INFO -->
                今天，你遇到了什么问题呢？
                <a href="/mod/question/sys/add/?cid=123" class="btn btn-primary btn-3d btn-block margin-top-10">提问</a>
            </div>
            {%else%}
            <div class="alert alert-info margin-bottom-20 box-shadow-4">
                <!-- INFO -->
                你好! 你还没有登录，请先登录.
                <a class="btn btn-block btn-social btn-dropbox margin-top-10  " href="/center/public/login" data-toggle="ajaxModal">
                    <i class="fa fa-sign-in"></i> 登录{{config.setup.WEB_SITE_TITLE}}
                </a>
            </div>
            {%endif%}
            <div class="panel panel-default">
                <div class="panel-heading">
                    <a class="btn btn-primary btn-xs pull-right" href="/topic">更多</a>
                    <h2 class="panel-title">热门话题</h2>
                </div>
                <div class="panel-body padding-10">
                    {% keywords data ="topic",type="hot",limit="5",cache="1000"%}
                    {%for k in topic%}
                    <div class="clearfix margin-bottom-10">
                        <!-- discussion item -->
                        {%if k.pic==0%}
                        <i class="ico-light ico-60 ico-hover et-chat pull-left margin-bottom-0 margin-top-0"></i>
                        {%else%}
                        <img class="thumbnail pull-left lazy" data-original="{{k.pic|get_pic('m=1,w=100,h=100')}}}}"
                            width="60" height="60" alt="" />
                        {%endif%}
                        <h4 class=" nomargin noborder nopadding bold"><a class="tag " href="{{k.url}}">
                                <span class="txt">{{k.keyname}}</span>
                                <span class="num"><i class="fa fa-fire"></i></span>
                            </a>
                        </h4>
                        <span class="size-13 text-muted">
                            {{k.videonum}} 个主题, {{k.focus_count}} 人关注
                        </span>
                    </div><!-- /discussion item -->
                    {%endfor%}
                </div>
            </div>
            {{HOOK@homeright|safe}}
            {{13|show_ad('code')|safe}}
        </div>
    </div>
    <div class="container">
        {{HOOK@homeEnd|safe}}
    </div>
</section>
{% endblock %}

{%block script%}

{%endblock%}